#include "graph_support/test_gs_version/TestGSVersion.h"

#include <vector>
#include <assert.h>

#include "graph_support/utils/test_my_graph/BoostTestUtils.h"

#include "graph_support/utils/CollectionsInit.h"
#include "graph_support/impls/vector/VectorGraph.h"
#include "graph_support/alg/shortest_path/Dejkstra.h"

/**
 * <<graph_support_4_boostunittes>>
 * here is hardcoded
 */
using namespace graph_support_4_boostunittes::impls::vector;
using namespace graph_support_4_boostunittes::alg::shortest_path;
using namespace graph_support_4_boostunittes::utils;

void TestTrivialDejkstraHardcodeVersion()
{
	typedef VectorGraphTmpl< int > Graph;
	typedef Graph::GrVertex GrVertex;

	std::vector< GrVertex > names =
			arr2vector< GrVertex >( ( GrVertex const [] )
				{ 0, 1, 2, 3, 4, 5, 6, 7 } );
	BOOST_CHECK_EQUAL( 8, names.size() );
	assert( 8 == names.size() );

	Graph gr( names );

	gr.addEdge( 0, 1 );
	gr.addEdge( 1, 2 );
	gr.addEdge( 2, 3 );
	gr.addEdge( 3, 4 );
	gr.addEdge( 4, 7 );
	gr.addEdge( 0, 5 );
	gr.addEdge( 5, 6 );
	gr.addEdge( 5, 7 );

	Dejkstra< Graph > dejkstra( gr );
	dejkstra( 0 );
	BOOST_CHECK_EQUAL( 2, dejkstra.getDistance( 7 ) );
	BOOST_CHECK_EQUAL( 4, dejkstra.getDistance( 4 ) );
}
